<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/include/taglibs.jsp"%>
<%
pageContext.setAttribute("crlf", "\r\n");
pageContext.setAttribute("lf", "\n");
pageContext.setAttribute("cr", "\r");
%>

<script type="text/javascript">
$(document).ready(function(){

});

function showContent(no){
	
	if($("#tr_content_"+no).css("display")=="none"){
		$(".tr_content").hide();
		$("#tr_content_"+no).show();	
	}else{
		$(".tr_content").hide();
	}
	
}

function deleteData(dt1,dt2,dt3,dt4){
	if(confirm("삭제하시겠습니까?")){
		location.href="./ubdmg0106T.do?bd_no="+dt1+"&p_id="+dt2+"&brd_no="+dt3+"&bd_pwd="+dt4;	
	}
}

</script>
<style type="text/css">
<!--
/* body {background-color: #ff00ff;} */
-->
</style>
<c:if test="${!empty sessionScope['userInfo'].admin_id || param.p_id == sessionScope['userInfo'].p_id }">
<table cellspacing="0" cellpadding="0" border="0" width="100%"
	style="margin: 20px 0px 4px 0px;" >
	<tr valign="bottom">
		<td></td>
		<td align="right"><a
			href="./ubdmg0102Q.do?p_id=${param.p_id }&brd_no=${param.brd_no }"
			class="ebbaord-default"><img
				src='/usr/images/ic-write.gif' border='0' vspace='0'></a></td>
	</tr>
</table>
</c:if>



<table width="100%" border="0" cellspacing="0" cellpadding="0"
	align="center">
	<tr>
		<td valign="top" align="center">
 <BR>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td height="1" class="css_line" colspan="2"></td>
				</tr>
<c:if test="${list !=null && fn:length(list)>0 }">
	<c:forEach var="map" items="${list}" varStatus="status">
				<tr class="css_title">
					<td width="25" class="css_title"><img
						src="/usr/images/faq_q.gif" align="absmiddle"></td>
					<td style="cursor: pointer;text-align: left;" onClick="showContent('${map.bd_no }')"
						class="css_title left_5px">${map.bd_title }</td>
				</tr>
				<tr id="tr_content_${map.bd_no }" style="display: none" class="css_default tr_content">
					<td align="center" height="30">&nbsp;</td>
					<td align="left" class="css_default">
${fn:replace(map.bd_content, cr, "<br/>")}
<c:if test="${!empty sessionScope['userInfo'].admin_id || param.p_id == sessionScope['userInfo'].p_id }">
						<table cellspacing="0" cellpadding="0" border="0" width="100%"
							style="margin: 20px 0px 4px 0px">
							<tr valign="bottom">
								<td align="right">
									<a href="./ubdmg0104Q.do?bd_no=${map.bd_no }&p_id=${map.p_id }&brd_no=${map.brd_no }&bd_pwd=${map.bd_pwd }" class="ebbaord-default"><img src="/usr/images/ic-modify.gif" border="0" vspace="0"></a>
									<a href="#" onclick="deleteData('${map.bd_no }','${map.p_id }','${map.brd_no }','${map.bd_pwd }');" class="ebbaord-default"><img src="/usr/images/ic-del.gif" border="0" vspace="0"></a>
								</td>
							</tr>
						</table>
</c:if>
					</td>
				</tr>
				<tr>
					<td height="1" class="css_line" colspan="2"></td>
				</tr>
	</c:forEach>
</c:if>
			</table> <!-- 메뉴출력 -->
			<table width="100%" border=0 cellspacing="2" cellpadding="4"
				STYLE="font: 9pt" align="center">
				<tr>
					<td valign="top" align="left">&nbsp;</td>
					<td valign="top" align="right">&nbsp;</td>
				</tr>
				<tr>
					<td colspan="2">
					${pageHtml }
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
